// 1.下载vue-router包：npm i vue-router@3
//2.引入包
import VueRouter from "vue-router";
import Vue from "vue";
import Home from "@/pages/Home";
import News from "@/pages/News";

//3.安装路由插件
Vue.use(VueRouter)

//4.实例化VueRouter
const router = new VueRouter({
    mode:'history',
    //路由表
    routes:[
        {
            path:'/home',
            component:Home
        },
        {
            path:'/news',
            component:News
        }
    ]
})

//4.导出路由器
export default router
